package test;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.HashMap;

import com.visec.hdy.transmission.rmi.RMIFactory;
import com.visec.hdy.transmission.rmi.code.RMIServer;
import com.visec.hdy.transmission.rmi.config.RMIModelCV;

public class RmiServer {
	public static void main(String[] args) throws RemoteException {
		RMIModelCV rmiModelCV = new RMIModelCV();
		rmiModelCV.setParams(new HashMap<String, String>());
		RMIServer createServer = RMIFactory.getInstance().createServer(rmiModelCV.getParameter());
		One o = new One();
		o.setName("sb");
		String oneUrl="rmi:/localhost:4400/one";
		
		System.out.println("-------------------------------------");
		
		createServer.bind(oneUrl, o);
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println("xxxxx");
		
		createServer.clearUnicast();
		
//		One lookup = (One)createServer.lookup(oneUrl);
//		System.out.println(lookup);
		
	}
}
